package com.ax.associator.store.dao;

import java.util.List;
import java.util.Map;

import com.ax.associator.store.domain.memberDto;
import org.apache.ibatis.annotations.Mapper;

import com.ax.associator.store.domain.BaseAssociator;
import org.apache.ibatis.annotations.Param;


@Mapper
public interface BaseAssociatorMapper {

    int deleteByPrimaryKey(Long associatorId);

    int insert(BaseAssociator record);

    /**
     * 新增会员
     * @param record
     * @return
     */
    Integer insertSelective(BaseAssociator baseAssociator);

    /**
     * 会员列表
     * @param associatorId
     * @return
     */
    List<memberDto> queryMember(Map<String, Object> params);

    /**
     * 会员总记录数
     * @return
     */
    Integer countMember();

    /**
     * 是否修改自身
     * @param associatorId
     * @param personId
     * @param phone
     * @return
     */
    Integer queryUpdateCount(@Param("associatorId") Long associatorId,@Param("personId")String personId,
                             @Param("phone")String phone);

    /**
     * 会员信息修改
     * @param record
     * @return
     */
    Integer updateBaseAssociator(BaseAssociator baseAssociator);

    /**
     * 删除会员
     * @param associatorId
     * @return
     */
    Integer deleteAssociator(@Param("associatorId")Long associatorId);
    
    //验证是否存在该会员
    Integer IfexistAssociator(@Param("personId") String personId,@Param("phone") String phone);
    //身份证验证
    Integer personId(@Param("personId") String personId);
    //电话号码验证
    Integer phone(@Param("phone")String phone);
    
    /**
	 * 查询会员(模块:会员中心)
	 * 
	 * @param Map<String, Object> map
	 *           
	 * @return PageUtils
	 */
    List<BaseAssociator> queryAssociatorMapper(Map<String,Object> map);
    
    /**
	 * 总计分页(模块:会员中心)
	 * 
	 * @param Map<String, Object> map
	 *           
	 * @return Integer
	 */
    Integer count(Map<String,Object> map);
}